package com.weiqk.pmdemo.dao;

import com.weiqk.pmdemo.pojo.ApplyLink;
import com.weiqk.pmdemo.pojo.Dic;
import com.weiqk.pmdemo.pojo.Purchase;
import com.weiqk.pmdemo.pojo.PurchaseLink;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface PurchaseLinkRespository extends PagingAndSortingRepository<PurchaseLink,Integer> {
    //通过id查找采购
    @Query(value = "select * FROM PM_PURCHASE_LINK where PURCHASE_ID=:n",nativeQuery = true)
    List<PurchaseLink> findOneById(@Param("n") int id);
    @Query(value = "select * FROM PM_PURCHASE_LINK where PURCHASE_ID=:n",nativeQuery = true)
    List<PurchaseLink> countPLinkByP(@Param("n") int id);
}
